* term.c: Integer and memory overflow issues.
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 29 Jul 2011 01:22:19 +0000 (18:22 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 29 Jul 2011 01:22:19 +0000 (18:22 -0700)
commit00ff54b155f0b486b8e4a955575e0f74990762f6
tree99ae12f4513e438509bfd1d6c980b937fe033db9
parent540e89e3d4c97ebb3157d76f186519069c68e400
* term.c: Integer and memory overflow issues.

(max_frame_lines): Remove; unused.
(encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
not int.
(encode_terminal_code, calculate_costs): Check for size
calculation overflow.
(encode_terminal_code): Use ptrdiff_t, not int, to record glyph
table lengths and related sizes.  Don't update size until alloc
done.  Redo calculations to avoid overflow.
(calculate_costs): Don't bother calling xmalloc when xrealloc will do.
src/ChangeLog
src/term.c